﻿{% extends 'base.html' %}

{% block styles %}
{{ block.super }}
<link rel="stylesheet" type="text/css" title="style" href="{{ STATIC_URL }}css/event.css" />
{% endblock %}

{% block content %}
  <div id="events_list_content">
    {% if user %}
      <form id="search_form" action="" method="post">
        <ul id="search">
          <li><label>Город: </label>{{ search_form.city }}</li>
          <li><label>Дата: </label>{{ search_form.datetime }}</li>
          <li><label>Цена: </label>{{ search_form.cost }}</li>
          <li><label>Сортировка: </label>{{ search_form.ordering }}</li>
        </ul>
        <input id="search_btn" class="btn gray" type="submit" value="Найти" />
      </form>
      <a id="create_event" class="btn green" href="{% url core.views.event.create %}" title="Создать мероприятие">Создать мероприятие</a>
    {% endif %}
     
    <h1 id="list_title">Список мероприятий</h1>
    {% for event in events %}
      <table id="events_table">
        <tr id="event_line">
          <td id="name"><a href="{% url core.views.event.details event.id %}">{{ event.name }}</a></td>
          <td id="cost">{{event.cost }}</td>
          <td id="date">{{ event.date }}</td>
          <td id="participants_count">{{ event.participants.count }}</td>
        </tr>
      </table>
    {% endfor %}
  </div>
{% endblock %}
